#include "stdlib.h"
#include "Tkgles.h"


EXPORT Display * glDisplay;
EXPORT Context * glContext;

EXPORT Context * getContext(){

	return glContext;
}

EXPORT void TkGlInit(){

	glContext = malloc(sizeof(Context));
	//Initiliaze variables' value

	glDisplay = initDisplay();

	MatrixInit();
	zBufferInit();
    ClearScreenBuffer();

	glContext->DepthRange.zFar = 1.0f;
	glContext->DepthRange.zNear = 0.0f;
	
	//Setup default value
	//fill_rect(0,0,240,320,WHITE,&(glDisplay->devbmp));
	printf("Finish init memory\n");
}

EXPORT void TkGlClose(){

	free(glDisplay);
	free(glContext);

}
